﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FileManager.ascx.cs" Inherits="Controls_Common_FileManager" %>
<%@ Import Namespace="Business" %>
<%@ Register Assembly="ASTreeView" Namespace="Geekees.Common.Controls" TagPrefix="cc1" %>
<div style="margin-top: 5px;">
    <ajaxToolkit:TabContainer ID="TabContainer1" Width="100%" runat="server" ActiveTabIndex="1">
        <ajaxToolkit:TabPanel runat="server" HeaderText="Files" ID="TabPanel1">
            <ContentTemplate>
                <table cellspacing="2" cellpadding="0" border="0" width="100%" style="min-height: 400px;">
                    <tbody>
                        <tr>
                            <td style="border: 1px solid Gray; margin: 0px; padding: 0px; background-color: White;
                                width: 70%">
                                <div style="width: 100%; min-height: 350px">
                                    <cc1:ASTreeView ID="astvMyTree" runat="server" BasePath="~/Resources/JS/treeview/astreeview/"
                                        DataTableRootNodeValue="0" EnableRoot="false" EnableNodeSelection="true" EnableCheckbox="false"
                                        EnableDragDrop="true" EnableTreeLines="true" EnableNodeIcon="true" EnableCustomizedNodeIcon="false"
                                        AutoPostBack="false" EnableDebugMode="false" EnableContextMenu="true" EnableAjaxOnEditDelete="true"
                                        EditNodeProvider="~/ASTreeViewRenameNodeHandler.aspx" DeleteNodeProvider="~/ASTreeViewDeleteNodeProvider.aspx"
                                        AddNodeProvider="~/ASTreeViewDemo3.aspx" AdditionalAddRequestParameters="{'t':'ajaxAdd'}"
                                        AddNodePromptDefaultValue="New Node" AddNodePromptMessage="Hello, please add a new node:"
                                        AddNodeDataValueProvider="return prompt('new ndoe? under:' + elem.getAttribute('treeNodeValue'),'new node name');"
                                        OnNodeAddedScript="addedHandler(elem)" OnNodeEditedScript="editedHandler(elem)"
                                        OnNodeDeletedScript="deletedHandler(val)" />
                                    <link href="<%= Config.ApplicationUrl%>Resources/JS/treeview/astreeview/astreeview.css"
                                        type="text/css" rel="stylesheet" />
                                    <link href="<%=Config.ApplicationUrl%>Resources/JS/treeview/contextmenu/contextmenu.css"
                                        type="text/css" rel="stylesheet" />

                                    <script src="<%=Config.ApplicationUrl%>Resources/JS/treeview/astreeview/astreeview_packed.js"
                                        type="text/javascript"></script>

                                    <script src="<%=Config.ApplicationUrl%>Resources/JS/treeview/contextmenu/contextmenu_packed.js"
                                        type="text/javascript"></script>

                                </div>
                            </td>
                            <td style="border: 1px solid Gray; margin: 0px; padding: 0px; background-color: White;
                                width: 30%">
                                <div style="width: 100%; min-height: 350px; vertical-align: top; text-align: center;">
                                    <div style="float: left; width: 100%; height: 100px; text-align: center; vertical-align: top">
                                        <img id="imgDisplay" src="<%=Config.ApplicationUrl%>Resources/images/admin/forms/NoImages.jpg"
                                            width="100" height="100" alt="display" /></div>
                                    <div style="float: left; width: 60px; height: 21px; text-align: center; vertical-align: top;
                                        padding-top: 10px">
                                        <span>Width : </span>
                                    </div>
                                    <div style="float: left; width: 100px; height: 21px; text-align: center; vertical-align: top">
                                        <input id="width" style="width: 70px" type="text" /></div>
                                    <div style="clear: both">
                                    </div>
                                    <div style="float: left; width: 60px; height: 21px; text-align: center; vertical-align: top;
                                        padding-top: 10px">
                                        <span>Height : </span>
                                    </div>
                                    <div style="float: left; width: 100px; height: 21px; text-align: center; vertical-align: top">
                                        <input id="Height" style="width: 70px" type="text" />
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="border: 1px solid Gray; margin: 0px; padding: 0px; background-color: White;">
                                <div style="width: 100%; min-height: 30px; text-align: right">
                                    <div style="width: 100px; float: right">
                                        <input id="Button1" type="button" value="ok" onclick="Select();" class="form-submit" />
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
        <ajaxToolkit:TabPanel runat="server" HeaderText="Upload" ID="TabPanel2">
            <ContentTemplate>
                <div class="Popup" style="text-align: center; overflow-y: none; vertical-align: middle;
                    width: 565px; height: 400px; z-index: 1400; background-color: #ccc; padding-left: 150px;
                    padding-top: 120px">
                    <div style="background-color: #ccc; width: 500px; height: 200px;">
                        <table style="width: 100%; border: 1px solid" cellpadding="0" cellspacing="0">
                            <tr>
                                <td colspan="3" style="text-align: center; vertical-align:middle; height:40px;">
                                    <h1>
                                        <%=Resources.Resource.FileUploadCenter %></h1>
                                </td>
                            </tr>
                            <tr>
                                <td style="width:40%">
                                    <%=Resources.Resource.SelectFile%>
                                </td>
                                <td>
                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                </td>
                                <td>
                                    <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />
                                </td>
                            </tr>
                              <tr style="height:50px;">
                                <td style="width:40%">
                                  
                                </td>
                                <td>
                                    
                                </td>
                                <td> </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </ContentTemplate>
        </ajaxToolkit:TabPanel>
    </ajaxToolkit:TabContainer>
</div>

<script language="javascript" type="text/javascript">
document.getElementById('__tab_ctl03_TabContainer1_TabPanel1').style.paddingTop='10px';
document.getElementById('__tab_ctl03_TabContainer1_TabPanel2').style.paddingTop='10px';
var url;
 //parameter must be "elem"
            function editedHandler(elem) {
               
            }
            SelectNode=function(name,width,height)
            {
            var day=new Date();
            url=name;
           document.getElementById('imgDisplay').src=name+'?'+day.getTime();
           document.getElementById('width').value=width;
           document.getElementById('Height').value=height;
            }
            Select=function()
            {
            if(url)
            parent.getImage(url);
            }

</script>

